#!/bin/bash
mydir=`dirname "$0"`
uninstallToolPath="$mydir/UninstallerTool"
installSubPath="Trapcode/Help/Form"
payloadFile="${mydir}/payload.pax.gz"
productName="TrapcodeForm"
productNumber="111"
installProductStr=`/usr/bin/grep -i "\<${productName}\>" "/tmp/rgs.C867B87B_3A5F_42DF_A83E_089FEDA01D63_${productNumber}"`
if [ ! -z "${installProductStr}" ]; then
    /usr/bin/xattr -d com.apple.quarantine "${payloadFile}"
    /bin/mkdir -p "$2/${installSubPath}"
    pushd "$2/${installSubPath}"
    /bin/pax -rzf "${payloadFile}"
    popd
    "$uninstallToolPath" -a "trapcode" "Trapcode" -a "trapcode.form" "Trapcode Form" -a "trapcode.form.AfterEffectsCS4" "Trapcode Form for After Effects CS4" "$2/${installSubPath}/Source_Files" "$2/${installSubPath}/Trapcode_Form_Help.html" "$2/Trapcode/Help/Form" "$2/Trapcode/Help" "$2/Trapcode"
fi
